php forum
php mysql forum
php mysql smarty
 
Page 2 of 4 < 1 2 3 4 >
Topic Options
#313397 - 03/05/07 07:50 PM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Cuervo Offline
User

Registered: 11/10/01
Posts: 29
I think I found one more issue

Code:
if (action == "spoiler") {
		var thisSpoiler = prompt("Enter Spoiler Data", "Spoiler Text");
		if (thisVideo == null){return;}

		insertAtCaret(document.replier.Body, ' ' + "[spoiler]" + thisSpoiler + "[/spoiler]" + ' ' );
		document.replier.texteditor.focus();
		return;
	}


should read

Code:
if (action == "spoiler") {
		var thisSpoiler = prompt("Enter Spoiler Data", "Spoiler Text");
		if (thisSpoiler == null){return;}

		insertAtCaret(document.replier.Body, ' ' + "[spoiler]" + thisSpoiler + "[/spoiler]" + ' ' );
		document.replier.texteditor.focus();
		return;
	}


There is an instance where thisVideo should read thisSpoiler but I'm not sure if that's why it is not placing the new text in the post. /edit after further testing it appears that this is why the text was not getting posted into the message when you would click ok on the box.


Edited by Cuervo (03/05/07 08:00 PM)
Edit Reason: more testing
_________________________
-Cuervo
zOMG and oNOES

Top
#313399 - 03/05/07 07:55 PM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Cuervo Offline
User

Registered: 11/10/01
Posts: 29
Well after some more testing is seems the thisSpoiler was the issue.

I have everything working now.

Thanks Gizmo for doing this code bit!!

I attach the spoiler.gif file I'm using.



Attachments
2366-spoiler.gif




Edited by Cuervo (03/05/07 07:58 PM)
_________________________
-Cuervo
zOMG and oNOES

Top
#313405 - 03/05/07 09:39 PM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
I'm not sure, I'll give some hacking a go later...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313407 - 03/05/07 10:37 PM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
I have this working:
Code:
in templates/default/standardtext_editor.tpl:
<a href="javascript: x()" onclick="DoPrompt('image');" title="{$lang.IMAGE_ALT}" alt="{$lang.IMAGE_ALT}"><img id="image" onmouseover="raiseButton(this.id);" onmouseout="normalButton(this.id);" onmousedown="lowerButton(this.id);" class="markup_panel_normal_button" src="{$config.BASE_URL}/images/{$style_array.markup_panel}/image.gif" /></a>

Add Under:
<a href="javascript: x()" onclick="DoPrompt('spoiler');" title="Spoiler" alt="Spoiler"><img id="spoiler" onmouseover="raiseButton(this.id);" onmouseout="normalButton(this.id);" onmousedown="lowerButton(this.id);" class="markup_panel_normal_button" src="{$config.BASE_URL}/images/{$style_array.markup_panel}/spoiler.gif" /></a>


In ubb_js/standard_text_editor.js:
Find:
	if (action == "image") {
		var thisImage = prompt(enterImage, "http://");
		if (thisImage == null){return;}

		insertAtCaret(document.replier.Body, ' ' + "[img]" + thisImage + "[/img]" + ' ' );
		document.replier.texteditor.focus();
		return;
	}

Add Under:
	if (action == "spoiler") {
		var thisSpoiler = prompt("Enter Spoiler", "");
		if (thisSpoiler == null){return;}

		insertAtCaret(document.replier.Body, ' ' + "[spoiler]" + thisSpoiler + "[/spoiler]" + ' ' );
		document.replier.texteditor.focus();
		return;
	}


You'll need to insert a spoiler.gif into your markup panel directory, I just copied the one for strikethrough
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313408 - 03/05/07 10:42 PM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Original post updated with markup panel instructions.
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313409 - 03/05/07 10:43 PM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
BTW, totally missed your second post lol
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313410 - 03/05/07 10:53 PM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
I cleaned up the spoiler graphic a bit, at least it looks good with a colored background, versus having a load of white shoved into it wink
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313430 - 03/07/07 11:24 PM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
I added another spoiler graphic; additionally, a thought to some on this... You could adapt it as a "not safe for work" tag... I've seen some communities whine about such things wink...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313436 - 03/08/07 02:03 AM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Added a regex filter to my initial post to filter spoiler content out of Active Topics.
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313437 - 03/08/07 02:12 AM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Cuervo Offline
User

Registered: 11/10/01
Posts: 29
Originally Posted By: Gizmo
I added another spoiler graphic; additionally, a thought to some on this... You could adapt it as a "not safe for work" tag... I've seen some communities whine about such things wink...


Another outstanding use for this mod!
_________________________
-Cuervo
zOMG and oNOES

Top
#313438 - 03/08/07 02:18 AM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
ADWOFF Offline
Content Queen

Registered: 05/07/01
Posts: 709
Loc: Pennsylvania
Originally Posted By: Gizmo
IF you wish to filter "spoiler content" from Active Topics:
open scripts/activetopics.inc.php
Find:
Code:
		$topics[$i]['forum_id'] = $forum_id;


Add Above:
Code:
		$post_body = preg_replace('/\[spoiler\](.*?)\[\/spoiler\]/si', '', $post_body);


Heya Giz~

I gave this a shot, and it did not take. frown

The spoiler part works, but it doesn't hide the text in Active Topics.

_________________________
Sue
adwoff.com

Top
#313439 - 03/08/07 02:23 AM Re: [7.x] UBB Spoiler Tags [Re: ADWOFF]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Cuervo: lol i noticed somethign last night when poking around a gardening sites forum, I laughed for like 20 minutes thinking of the "inappropriate lawn gnomes" I stumbled on, and the person who was at work who opened it...

Sue: Very odd, it works on my 7.1 demo site... I'll poke in and take a gander in a bit.
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313440 - 03/08/07 02:28 AM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Hmmm, seems that the active topics doesn't show the tags themselves when they're parsed (duah on my part, I can't believe I didn't think about that)...

I'll need to think, because I believe the data in the active topics doesn't take tags used into account...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313441 - 03/08/07 02:48 AM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
I'm still working on the regex, I'm not sure what's wrong with it yet... It seems like something isn't parsing on it, but so far what I have is:
Code:
		$post_body = preg_replace('/<div class="ubbcode-block"><div class="ubbcode-header">Warning, Spoiler: <input type="button" value="Show" (.*?) \/><\/div><div class="ubbcode-body"><div style="display: none;">(.*?)<\/div><\/div><\/div>/si', '', $post_body);


It'll at least retard the viewing of the spoiler, well, the post in general... I'll try to get it working as soon as i can figure out what i'm b0gging lol
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313442 - 03/08/07 03:02 AM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Well, seems that works just fine and Ive been working on n issue which wasn't there lol... I made a couple spoiler posts to test the regex on, and turns out that the one i was working with, didn't have any other content in the post; so when it filtered the spoiler, i was going nutty lol...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313443 - 03/08/07 03:13 AM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
updated initial posting:
1. New spoiler graphic.
2. Updated spoiler code, now uses the style for forum buttons.
3. Added regex entries for scripts/activetopics.inc.php to filter out all spoiler entries from the activetopics.

Also, if you want to display [spoiler] instead of no spoiler text, in the new entries in the activetopics.inc.php simply put in:
Code:
		$post_body = preg_replace('/\[spoiler\](.*?)\[\/spoiler\]/si', '[spoiler]', $post_body);
		$post_body = preg_replace('/<div class="ubbcode-block"><div class="ubbcode-header">(.*?)<\/div><div class="ubbcode-body"><div style="display: none;">(.*?)<\/div><\/div><\/div>/si', '[spoiler]', $post_body);


instead of
Code:
		$post_body = preg_replace('/\[spoiler\](.*?)\[\/spoiler\]/si', '', $post_body);
		$post_body = preg_replace('/<div class="ubbcode-block"><div class="ubbcode-header">(.*?)<\/div><div class="ubbcode-body"><div style="display: none;">(.*?)<\/div><\/div><\/div>/si', '', $post_body);
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313470 - 03/10/07 05:03 AM Re: [7.x] UBB Spoiler Tags [Re: Gizmo]
Cuervo Offline
User

Registered: 11/10/01
Posts: 29
Originally Posted By: Gizmo
Cuervo: lol i noticed somethign last night when poking around a gardening sites forum, I laughed for like 20 minutes thinking of the "inappropriate lawn gnomes" I stumbled on, and the person who was at work who opened it...

Sue: Very odd, it works on my 7.1 demo site... I'll poke in and take a gander in a bit.


I could so see someone telling their boss to come look at this site, it has a great post about growing tomatoes and woops!
_________________________
-Cuervo
zOMG and oNOES

Top
#313474 - 03/10/07 02:12 PM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Lol it was on topic... IT was talking about lawn gnomes haha...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#313592 - 03/17/07 07:07 PM Re: [7.x] UBB Spoiler Tags [Re: Cuervo]
jgeoff Offline
Power User

Registered: 04/05/01
Posts: 97
Loc: NJ

Giz, I'm getting this error in 7.1 (I didn't apply any of the markup panel stuff)

Parse error: syntax error, unexpected T_STRING, expecting ')' in /home2/gbb/public_html/threads/libs/ubbthreads.inc.php on line 1011
_________________________
GangsterBB.NET (Ver. 7.3)
2007 Content Rulez Contest - Honorable Mention
UBB.classic 6.7.2 - RIP
Browser: Firefox 2.0

Top
#313594 - 03/17/07 08:23 PM Re: [7.x] UBB Spoiler Tags [Re: jgeoff]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Could you paste me exactly what you put in the ubbcode block for the spoiler tag? What it looks like is that you're missing the ),
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
Page 2 of 4 < 1 2 3 4 >



Moderator:  sirdude 
Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks